//clodufunctions/todo/index.js

const cloud = require('wx-server-sdk')
const list = require('./list/index')
const task = require('./task/index')
cloud.init()

exports.main = async (event, context) => {
  switch (event.type) {
    case "list":
      return await list.main(event, context);
      break;
    case "list/add":
      return await list.add(event, context);
      break;
    case "task/get":
      return await task.get(event, context);
      break;
    case "task/getByTime":
      return await task.getbytime(event, context);
      break;
    case "task/add":
      return await task.add(event, context);
      break;
    case "task/do":
      return await task.do(event, context);
      break;
    case "task/weektodos":
      return await task.weekstodo(event, context);
      break;
    default:
      break;
  }

}